<?php
namespace app\admin\model;
use think\Model;
class Yuyue extends Model{
	
	protected $table = 'house_yuyue';
	protected $pk = 'z_id';
	
	public function number()
    {
        return $this->hasOne('number','n_id','n_id');
    }
     public function rom()
    {
        return $this->hasOne('rom','r_id','r_id');
    }
    public function chuli($id){
    	$list = self::sava(['z_status'=>'已处理'],['z_id'=>$id]);
    	return $list;
    }
    public function upd(){
		//halt(input('param.z_id'));
		$yu = new Yuyue();
		$result = $yu->save([
		  'z_status'=>input("param.z_status"),
		  'result'=>input("param.result"),
		  'z_type'=>input("param.z_type"),
		],['z_id'=>input('param.z_id')]);
		
		//$result = input('post.');
		//halt($result);
		return $result;
	}
	public function add(){
		
//		$data=[
//				'n_id'=>input("param.n_id"),
//		       'rom_id'=>input("param.r_id"),
//		       't_id'=>input("param.t_id"),
//		       'area'=>input("param.area"),
//		  	'tel'=>input("param.tel"),
//		   	'yajin'=>input("param.yajin"),
//		   'parment_method'=>input("param.p_id"),
//		   'zujin'=>input("param.zujin"),
//		   'guanliyuan'=>input("param.guanliyuan")
//			];
		$data = input('post.');
		
		$yu = new Yuyue();
		
		$result = $yu->save($data);
		return $result;
	}
	
}
?>